

function(conan_message MESSAGE_OUTPUT)
    if(NOT CONAN_CMAKE_SILENT_OUTPUT)
        message(${ARGV${0}})
    endif()
endfunction()


macro(conan_find_apple_frameworks FRAMEWORKS_FOUND FRAMEWORKS FRAMEWORKS_DIRS)
    if(APPLE)
        foreach(_FRAMEWORK ${FRAMEWORKS})
            # https://cmake.org/pipermail/cmake-developers/2017-August/030199.html
            find_library(CONAN_FRAMEWORK_${_FRAMEWORK}_FOUND NAMES ${_FRAMEWORK} PATHS ${FRAMEWORKS_DIRS} CMAKE_FIND_ROOT_PATH_BOTH)
            if(CONAN_FRAMEWORK_${_FRAMEWORK}_FOUND)
                list(APPEND ${FRAMEWORKS_FOUND} ${CONAN_FRAMEWORK_${_FRAMEWORK}_FOUND})
            else()
                message(FATAL_ERROR "Framework library ${_FRAMEWORK} not found in paths: ${FRAMEWORKS_DIRS}")
            endif()
        endforeach()
    endif()
endmacro()


function(conan_package_library_targets libraries package_libdir deps out_libraries out_libraries_target build_type package_name)
    unset(_CONAN_ACTUAL_TARGETS CACHE)
    unset(_CONAN_FOUND_SYSTEM_LIBS CACHE)
    foreach(_LIBRARY_NAME ${libraries})
        find_library(CONAN_FOUND_LIBRARY NAMES ${_LIBRARY_NAME} PATHS ${package_libdir}
                     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
        if(CONAN_FOUND_LIBRARY)
            conan_message(STATUS "Library ${_LIBRARY_NAME} found ${CONAN_FOUND_LIBRARY}")
            list(APPEND _out_libraries ${CONAN_FOUND_LIBRARY})
            if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
                # Create a micro-target for each lib/a found
                string(REGEX REPLACE "[^A-Za-z0-9.+_-]" "_" _LIBRARY_NAME ${_LIBRARY_NAME})
                set(_LIB_NAME CONAN_LIB::${package_name}_${_LIBRARY_NAME}${build_type})
                if(NOT TARGET ${_LIB_NAME})
                    # Create a micro-target for each lib/a found
                    add_library(${_LIB_NAME} UNKNOWN IMPORTED)
                    set_target_properties(${_LIB_NAME} PROPERTIES IMPORTED_LOCATION ${CONAN_FOUND_LIBRARY})
                    set(_CONAN_ACTUAL_TARGETS ${_CONAN_ACTUAL_TARGETS} ${_LIB_NAME})
                else()
                    conan_message(STATUS "Skipping already existing target: ${_LIB_NAME}")
                endif()
                list(APPEND _out_libraries_target ${_LIB_NAME})
            endif()
            conan_message(STATUS "Found: ${CONAN_FOUND_LIBRARY}")
        else()
            conan_message(STATUS "Library ${_LIBRARY_NAME} not found in package, might be system one")
            list(APPEND _out_libraries_target ${_LIBRARY_NAME})
            list(APPEND _out_libraries ${_LIBRARY_NAME})
            set(_CONAN_FOUND_SYSTEM_LIBS "${_CONAN_FOUND_SYSTEM_LIBS};${_LIBRARY_NAME}")
        endif()
        unset(CONAN_FOUND_LIBRARY CACHE)
    endforeach()

    if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
        # Add all dependencies to all targets
        string(REPLACE " " ";" deps_list "${deps}")
        foreach(_CONAN_ACTUAL_TARGET ${_CONAN_ACTUAL_TARGETS})
            set_property(TARGET ${_CONAN_ACTUAL_TARGET} PROPERTY INTERFACE_LINK_LIBRARIES "${_CONAN_FOUND_SYSTEM_LIBS};${deps_list}")
        endforeach()
    endif()

    set(${out_libraries} ${_out_libraries} PARENT_SCOPE)
    set(${out_libraries_target} ${_out_libraries_target} PARENT_SCOPE)
endfunction()


include(FindPackageHandleStandardArgs)

conan_message(STATUS "Conan: Using autogenerated Findaws-c-http.cmake")
# Global approach
set(aws-c-http_FOUND 1)
set(aws-c-http_VERSION "0.6.13")

find_package_handle_standard_args(aws-c-http REQUIRED_VARS
                                  aws-c-http_VERSION VERSION_VAR aws-c-http_VERSION)
mark_as_advanced(aws-c-http_FOUND aws-c-http_VERSION)


set(aws-c-http_INCLUDE_DIRS "/root/.conan/data/aws-c-http/0.6.13/_/_/package/d052fd454c9f0eb936b3eae737c6b1f5b595ce2a/include")
set(aws-c-http_INCLUDE_DIR "/root/.conan/data/aws-c-http/0.6.13/_/_/package/d052fd454c9f0eb936b3eae737c6b1f5b595ce2a/include")
set(aws-c-http_INCLUDES "/root/.conan/data/aws-c-http/0.6.13/_/_/package/d052fd454c9f0eb936b3eae737c6b1f5b595ce2a/include")
set(aws-c-http_RES_DIRS )
set(aws-c-http_DEFINITIONS )
set(aws-c-http_LINKER_FLAGS_LIST
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:>"
)
set(aws-c-http_COMPILE_DEFINITIONS )
set(aws-c-http_COMPILE_OPTIONS_LIST "" "")
set(aws-c-http_COMPILE_OPTIONS_C "")
set(aws-c-http_COMPILE_OPTIONS_CXX "")
set(aws-c-http_LIBRARIES_TARGETS "") # Will be filled later, if CMake 3
set(aws-c-http_LIBRARIES "") # Will be filled later
set(aws-c-http_LIBS "") # Same as aws-c-http_LIBRARIES
set(aws-c-http_SYSTEM_LIBS )
set(aws-c-http_FRAMEWORK_DIRS )
set(aws-c-http_FRAMEWORKS )
set(aws-c-http_FRAMEWORKS_FOUND "") # Will be filled later
set(aws-c-http_BUILD_MODULES_PATHS "/root/.conan/data/aws-c-http/0.6.13/_/_/package/d052fd454c9f0eb936b3eae737c6b1f5b595ce2a/lib/cmake/conan-official-aws-c-http-targets.cmake")

conan_find_apple_frameworks(aws-c-http_FRAMEWORKS_FOUND "${aws-c-http_FRAMEWORKS}" "${aws-c-http_FRAMEWORK_DIRS}")

mark_as_advanced(aws-c-http_INCLUDE_DIRS
                 aws-c-http_INCLUDE_DIR
                 aws-c-http_INCLUDES
                 aws-c-http_DEFINITIONS
                 aws-c-http_LINKER_FLAGS_LIST
                 aws-c-http_COMPILE_DEFINITIONS
                 aws-c-http_COMPILE_OPTIONS_LIST
                 aws-c-http_LIBRARIES
                 aws-c-http_LIBS
                 aws-c-http_LIBRARIES_TARGETS)

# Find the real .lib/.a and add them to aws-c-http_LIBS and aws-c-http_LIBRARY_LIST
set(aws-c-http_LIBRARY_LIST aws-c-http)
set(aws-c-http_LIB_DIRS "/root/.conan/data/aws-c-http/0.6.13/_/_/package/d052fd454c9f0eb936b3eae737c6b1f5b595ce2a/lib")

# Gather all the libraries that should be linked to the targets (do not touch existing variables):
set(_aws-c-http_DEPENDENCIES "${aws-c-http_FRAMEWORKS_FOUND} ${aws-c-http_SYSTEM_LIBS} aws-c-compression::aws-c-compression;aws-c-common::aws-c-common;aws-c-io::aws-c-io")

conan_package_library_targets("${aws-c-http_LIBRARY_LIST}"  # libraries
                              "${aws-c-http_LIB_DIRS}"      # package_libdir
                              "${_aws-c-http_DEPENDENCIES}"  # deps
                              aws-c-http_LIBRARIES            # out_libraries
                              aws-c-http_LIBRARIES_TARGETS    # out_libraries_targets
                              ""                          # build_type
                              "aws-c-http")                                      # package_name

set(aws-c-http_LIBS ${aws-c-http_LIBRARIES})

foreach(_FRAMEWORK ${aws-c-http_FRAMEWORKS_FOUND})
    list(APPEND aws-c-http_LIBRARIES_TARGETS ${_FRAMEWORK})
    list(APPEND aws-c-http_LIBRARIES ${_FRAMEWORK})
endforeach()

foreach(_SYSTEM_LIB ${aws-c-http_SYSTEM_LIBS})
    list(APPEND aws-c-http_LIBRARIES_TARGETS ${_SYSTEM_LIB})
    list(APPEND aws-c-http_LIBRARIES ${_SYSTEM_LIB})
endforeach()

# We need to add our requirements too
set(aws-c-http_LIBRARIES_TARGETS "${aws-c-http_LIBRARIES_TARGETS};aws-c-compression::aws-c-compression;aws-c-common::aws-c-common;aws-c-io::aws-c-io")
set(aws-c-http_LIBRARIES "${aws-c-http_LIBRARIES};aws-c-compression::aws-c-compression;aws-c-common::aws-c-common;aws-c-io::aws-c-io")

set(CMAKE_MODULE_PATH "/root/.conan/data/aws-c-http/0.6.13/_/_/package/d052fd454c9f0eb936b3eae737c6b1f5b595ce2a/" ${CMAKE_MODULE_PATH})
set(CMAKE_PREFIX_PATH "/root/.conan/data/aws-c-http/0.6.13/_/_/package/d052fd454c9f0eb936b3eae737c6b1f5b595ce2a/" ${CMAKE_PREFIX_PATH})

if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
    # Target approach
    if(NOT TARGET aws-c-http::aws-c-http)
        add_library(aws-c-http::aws-c-http INTERFACE IMPORTED)
        if(aws-c-http_INCLUDE_DIRS)
            set_target_properties(aws-c-http::aws-c-http PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
                                  "${aws-c-http_INCLUDE_DIRS}")
        endif()
        set_property(TARGET aws-c-http::aws-c-http PROPERTY INTERFACE_LINK_LIBRARIES
                     "${aws-c-http_LIBRARIES_TARGETS};${aws-c-http_LINKER_FLAGS_LIST}")
        set_property(TARGET aws-c-http::aws-c-http PROPERTY INTERFACE_COMPILE_DEFINITIONS
                     ${aws-c-http_COMPILE_DEFINITIONS})
        set_property(TARGET aws-c-http::aws-c-http PROPERTY INTERFACE_COMPILE_OPTIONS
                     "${aws-c-http_COMPILE_OPTIONS_LIST}")
        
        # Library dependencies
        include(CMakeFindDependencyMacro)

        if(NOT aws-c-compression_FOUND)
            find_dependency(aws-c-compression REQUIRED)
        else()
            message(STATUS "Dependency aws-c-compression already found")
        endif()


        if(NOT aws-c-common_FOUND)
            find_dependency(aws-c-common REQUIRED)
        else()
            message(STATUS "Dependency aws-c-common already found")
        endif()


        if(NOT aws-c-io_FOUND)
            find_dependency(aws-c-io REQUIRED)
        else()
            message(STATUS "Dependency aws-c-io already found")
        endif()

    endif()
endif()

foreach(_BUILD_MODULE_PATH ${aws-c-http_BUILD_MODULES_PATHS})
    include(${_BUILD_MODULE_PATH})
endforeach()
